﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tema_IP_BuyCar
{
    class Client
    {
        private string nume;
        private string varsta;
        private List<AbstractCar> CarPool=new List<AbstractCar>();
        public Client(string nume, string varsta, AbstractCarFactory factory, String culoare, String transmisie, string dotari, string motorizare, string dimensiuni)
        {
            
            CarPool.Add(factory.CreateCar(culoare,transmisie,dotari,motorizare,dimensiuni));
            this.nume = nume;
            this.varsta = varsta;
            
        }
        public string get_nume()
        {
            return this.nume;
        }
        public void add_car(AbstractCarFactory factory, String culoare, String transmisie, string dotari, string motorizare, string dimensiuni)
        {
           
            CarPool.Add(factory.CreateCar(culoare, transmisie, dotari, motorizare, dimensiuni));
            
            
        }
        public void remove_car(AbstractCarFactory factory, String culoare, String transmisie, string dotari, string motorizare, string dimensiuni)
        {
            AbstractCar car_to_remove = factory.CreateCar(culoare, transmisie, dotari, motorizare, dimensiuni);
            CarPool.Remove(car_to_remove);
        }
        public void print_client()
        {
            Console.WriteLine("\n______CLIENT_______\n");
            Console.WriteLine("Nume client");
            Console.WriteLine(this.nume);
            Console.WriteLine("Varsta client");
            Console.WriteLine(this.varsta);
            foreach (AbstractCar t_car in this.CarPool)
            {
                t_car.print_car();
            }
        }
    }
    
}
